package homework.jdbc.dao;

import java.sql.*;

/**
 * Created by Administrator on 2017/9/13.
 */
//连接驱动 数据库
public class JDriverUtils {
    public static Connection getConnection() throws SQLException {
        Connection con =null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            con = DriverManager.getConnection("jdbc:mysql://localhost:3307/user"
                    ,"root","123456");
            return con;
        } catch (Exception e) {
            e.printStackTrace();
        }
        con.close();
        return null;
    }
}
